/**
 * @Project RSLsXWG
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 30, 2011
 * @Createtime 9:53:42 PM
 */

package com.xwg.services
{
	import mx.rpc.CallResponder;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;

	public class HGHTTPService extends HTTPService
	{
		private var _callResponder:CallResponder;

		public function HGHTTPService(url:String, rootURL:String = null, destination:String = null)
		{
			super(rootURL, destination);

			this.url = url;

			_callResponder = new CallResponder();
			_callResponder.addEventListener(ResultEvent.RESULT, _resultHandler);
			_callResponder.addEventListener(FaultEvent.FAULT, _faultHandler);

			_callResponder.token = this.send();
		}

		private function _faultHandler(event:FaultEvent):void
		{
			// dispatchEvent(event); // duplicated!!!
		}

		private function _resultHandler(event:ResultEvent):void
		{
			// dispatchEvent(event); // duplicated!!!
		}
	}
}